﻿using System;
using System.Collections.Generic;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Kators.Services
{
    public class FileService
    {

        public static string BrowsingFilePath()
        {
            OpenFileDialog openFileDialog = new OpenFileDialog();

            openFileDialog.InitialDirectory = @"C:\";
            openFileDialog.Filter = "Pictures (*.bmp;*.jpg;*.gif;*.png;*.tif)|*.bmp;*.jpg;*.gif;*.png;*.tif|All files (*.*)|*.*";
            openFileDialog.Multiselect = false;

            if (openFileDialog.ShowDialog() == DialogResult.OK)
            {
                return openFileDialog.FileName; 
                
            }
            else
            {
                return null; 
            }
        }

        public static Image ShowPictureFile(string pictureFilePath)
        {
            //Configuration.SourceFilePath = pictureFilePath;
            //TeamLogoFileExt = selectedTeam.LogoFileExt;

            FileStream fs = new FileStream(pictureFilePath, FileMode.Open, FileAccess.Read);
            Image image = Image.FromStream(fs);
            //pictureBox1.Image = image;
            fs.Close();

            return image; 
        }



    }
}
